package com.fedoom.frontend.models;

import javax.swing.JComboBox;

/*
 * Holds the values for the level options.
 */
public class LevelSettingModel {
	//Constants
	final int MAX_LEVEL_UPPER_LIMIT = 33;
	
	//Data members
	private String[] levelList;
	
	public LevelSettingModel() {

	}
	
	/*
	 * Returns the level values.
	 */
	public String[] getLevelList() {
		return levelList;
	}
	
	/*
	 * Sets the level values (string array).
	 */
	public void setDifficultyList(String[] levelList) {
		this.levelList = levelList;
	}
	
	/*
	 * Returns a populated JComboBox with the level values.
	 */
	public JComboBox getComponentAndList() {
		this.levelList = new String[MAX_LEVEL_UPPER_LIMIT];
		populateLevelList();
		
		return new JComboBox(this.levelList);
	}
	
	private void populateLevelList() {
		try {
			populateList();
		} catch (Exception ex) {
			
		}
	}

	private void populateList() {
		this.levelList[0] = "default";
		for (int i = 1; i < MAX_LEVEL_UPPER_LIMIT; i++) {
			this.levelList[i] = Integer.toString(i);
		}
	}
	
}
